#!/bin/bash
#
# mkpod
# SPDX-FileCopyrightText: © 2007 Hewlett-Packard Development Company, L.P.

# SPDX-License-Identifier: GPL-2.0-only
#
# simple script to generate man pages from pod sources
# TODO: process version parameter.... need to be able to pass one in.
#
usage='mkpod <input-file>, input file should be a pod file.'

infile=$1
version=$2
if [[ -z $infile ]]
then
	echo $usage
fi

if [[ -z $version ]]
then
	echo "Setting version to 0.dev"
	version='0.dev'
fi

name=${infile%.pod}

#echo "name is:$name"
#exit

pod2man --center="$name" --release="Version $version" "$infile" > "$name.1"

# HTML
pod2html --infile=$infile --outfile=$name.html

#Text
pod2text $infile $name.txt

